package Demo_8_28;

public class Demo03 {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (this.age>=18){
            System.out.println("合法");
        }else {
            System.out.println("不合法");
        }
        this.age = age;
    }
}
